package api.txSplash;

import android.view.ViewGroup;

import java.lang.ref.SoftReference;


public abstract class Splash_API_BD {

   public static String clazz = "api.bdAPI.BD_Splash";

    private static SoftReference<Splash_API_BD> sf;

    public synchronized static Splash_API_BD getInstance() {

        if (sf == null || sf.get() == null) {
            Object o = null;
            try {
                o = Class.forName(clazz).newInstance();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            }
            if (o != null) {
                sf = new SoftReference<>((Splash_API_BD) o);
                return (Splash_API_BD) o;
            }
        }
        return sf == null ? null : sf.get();
    }

    public abstract void LoadSplash( ViewGroup view,  String appid, String adposid, SplashListener listener);


    public interface SplashListener {
        void onPresent();
        void onDismissed();
        void onLpClosed();
        void onFailed( String msg);
        void onClick();
    }
}
